{% extends 'base.html' %}
{% block title %}
{{ title }}
{% endblock %}
{% block header %}
    搜索结果
{% endblock %}
{% block content %}

    {% for article in articles %}
    <div class="card mt-2 mb-2 border-warning">
        <div class="card-body">
            <h4 class="card-title">
                <span class="badge badge-danger">
                    {{ article.get_category_display }}
                </span>
                <a href="/article/{{ article.article_id }}">
                    {{ article.title }}
                </a>
            </h4>
            <p class="card-text">
                {{ article.content|truncatechars:20 }}...
            </p>
            <small>
                {{ article.post_datetime }}
                阅读数：{{ article.read_count }}
            </small>
        </div>
    </div>
    {% endfor %}
{% endblock %}